package com.bidevalution.business.impl;

import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.bidevalution.business.service.BeManagerNodeService;
import com.bidevalution.business.service.BeSectionInfoService;
import com.bidevalution.business.service.JdbcTemplateService;
import com.bidevalution.dao.entity.BeSectionInfo;
import com.bidevalution.support.util.MapUtil;

@Service
public class BeManagerNodeServiceImpl implements BeManagerNodeService {
	@Autowired
	private JdbcTemplateService JdbcTemplateService;
	@Autowired
	private BeSectionInfoService beSectionInfoService;

	@Override
	public List<Map<String, Object>> selectList(String sectionId, String type) {
		BeSectionInfo beSectionInfo = beSectionInfoService.getBeSectionInfoById(sectionId);
		return JdbcTemplateService.selectForList(
				"select mano_ManageNodeID as value,mano_Name as label from td_managenode where mano_ProjectID=:projectId and mano_Type=:type",
				MapUtil.create().putValue("projectId", beSectionInfo.getTdProjectid()).putValue("type", type).getMap());
	}

}
